package parsers;

public class UrlParser {

	private String url;
	private String protocol;
	private String domain;
	private String path;

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}
	
	public String getProtocol() {
		int i = url.indexOf(":");
		protocol = url.substring(0, i);
		return this.protocol;
	}
	
	public String getDomain(){
		String delimiter = "/";
		String[] temp = url.split(delimiter);
		domain = temp[2];
		return this.domain;
	}
	
	public String getPath(){
		String delimiter = "/";
		String[] temp = url.split(delimiter);
		path = temp[3];
		return this.path;
	}
}
